package fifthwork.two.inherit;

import fifthwork.two.Shape;

/**
 * @author ：chenzikang
 * @date ： 2020/3/24
 */

/**

三角形的继承类
 */

public class TriangleShape extends Shape {

    public TriangleShape(double bottom, double high) {
        this.bottom = bottom;
        this.high = high;
    }


    private double bottom;
    private double high;

    public double getBottom() {
        return bottom;
    }

    public void setBottom(double bottom) {
        this.bottom = bottom;
    }

    public double getHigh() {
        return high;
    }

    public void setHigh(double high) {
        this.high = high;
    }

    @Override
    public double area() {
        return getBottom()*getHigh()/2;
    }
}
